{extend name="page_base" /} {block name="seo"}
<title>意见反馈 - {$site_config['seo_title']}</title>
<meta name="keywords" content="{$site_config['seo_keyword']}">
<meta name="description" content="{$site_config['seo_description']}">
{/block}
{block name="css"}

{/block}
{block name="main"}
<div class="title">
    <h3>意见反馈</h3>
</div>
<div class="thisContent layui-clear">
    <form class="send layui-form">

                    <textarea name="opinion" lay-verify="min_10_max_300" placeholder="请输入您要反馈的内容"
                              style="height:200px;float:left;"></textarea>
        <input type="text" name="qq"  maxlength="11" lay-verify="min_2" placeholder="您的QQ号"
               style="margin-top:20px;float:left;width:calc(100% - 288px);"/>
        <input name="captcha" lay-verify="required" maxlength="4" type="text" placeholder="验证码"
               style="margin-top:20px;float:left;width:120px;margin-left:4%"/>
        <img src="{:url('index/page/captcha')}?'+Math.random();" title="点击可刷新验证码"
             onclick="this.src='{:url('index/page/captcha')}?'+Math.random();" id="img_code"
             style="margin-top:20px;width:144px;height:45px;cursor:pointer">
        <input type="submit" lay-submit lay-filter="save_btn" value="提 交" class="btn"
               style="margin-top:30px;"/>
    </form>
</div>
{/block}
{block name="script"}
<script>
    layui.use(['layer', 'form'], function () {
        var layer = layui.layer;
        var form = layui.form;

        form.verify({
            link: [
                /(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&:/~\+#]*[\w\-\@?^=%&/~\+#])?/
                , '小可爱，网址不正确哦,(带上http或者htpps)'
            ],
            qq: [
                /^[1-9]([0-9]{5,11})$/,
                'QQ号格式不正确！'
            ],
            min_10_max_300: [
                /^.{10,300}$/,
                '请输入10到300位字符'
            ]
        });
        form.on('submit(save_btn)', function (data) {
            request({
                data: {
                    data: data.field,
                    post_type: 'add_opinion'
                },
                done: function (res) {
                    $("#img_code").click();
                }
            });
            return false;
        });
    });
</script>
{/block}